package com.mujin.keji.collectionsystem.utils;

import android.text.TextUtils;

public class StringUtil {

    public static String getTuomin(String account){

        if(TextUtils.isEmpty(account)){
            return "";
        }
        if(account.length() >= 6){
            return  account.substring(0,account.length() - 6 ) + "******";
        }else if(account.length() >= 2){
            return  account.substring(0,account.length() - 2 ) + "**";
        }else{
            return account;
        }

    }

    public static String hiddenBankCard(String bankCard){

        if(TextUtils.isEmpty(bankCard)){
            return "";
        }

        if(bankCard.length() >= 12){
            //隐藏6-8位
            return bankCard.substring(0,4) + "********" + bankCard.substring(12,bankCard.length());
        }else{
            return bankCard;
        }

    }


}
